import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { RenderType } from '@pkg/setting';
export const columns: BasicColumn[] = [
  {
    title: '商户名称',
    dataIndex: 'fuIouParamName',
    width: 200,
  },
  {
    title: '富友商户号',
    dataIndex: 'mchntCd',
    width: 200,
  },
  {
    title: '小程序支付是否使用插件',
    dataIndex: 'useFuIouMiniPlugin',
    width: 200,
    dictData: [
      { label: '不使用插件', value: 0 },
      { label: '使用插件', value: 1 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 200,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'fuIouParamName',
    label: '商户名称',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'mchntCd',
    label: '商户号',
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '富友支付参数Id',
    field: 'fuIouPayParamId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '富友商户名称',
    field: 'fuIouParamName',
    component: 'Input',
    required: true,
  },
  {
    label: '富友商户号',
    field: 'mchntCd',
    component: 'Input',
    required: true,
  },
  {
    label: '富友公钥',
    field: 'fuIouPublicKey',
    component: 'InputTextArea',
    required: true,
    componentProps: {
      autosize: true,
    },
  },
  {
    label: '商户公钥',
    field: 'publicKey',
    component: 'InputTextArea',
    required: true,
    componentProps: {
      autosize: true,
    },
  },
  {
    label: '商户私钥',
    field: 'privateKey',
    component: 'InputTextArea',
    required: true,
    componentProps: {
      autosize: true,
    },
  },
  {
    label: '小程序支付插件',
    field: 'useFuIouMiniPlugin',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        { label: '不使用插件', value: 0 },
        { label: '使用插件', value: 1 },
      ],
    },
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    required: false,
  },
];
